﻿//编写一个函数，返回double数组中最大值和最小的数之间的差值
#include<stdio.h>
#define N 400
double CH(double a[],int n);
int main(){ 
    double a[N];   
    int n, i; 
    scanf("%d",&n); 
    for(i=0;i<n;i++)      
        scanf("%lf",&a[i]); 
    printf("%.2lf",CH(a,n));  
    return 0;
}
double CH(double a[],int n){ 
    int i; 
    double max = a[0]; 
    double min = a[0]; 
    double c; 
    for (i = 0; i < n; i++)   { 
        if(max < a[i])      
            max = a[i];  
        if(min > a[i])       
            min = a[i];  
    }  
    c = max - min; 
    return c;
}
